package edu.tyut.game.ui.community

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import androidx.lifecycle.switchMap
import edu.tyut.game.logic.FriendCircleRepository
import edu.tyut.game.utils.LogUtils
import okhttp3.MultipartBody

class UpdatePostFriendCircleViewModel : ViewModel(){

    private val tag = this::class.java.name

    // 编辑朋友圈
    private val editFriendCircleLiveData = MutableLiveData<List<MultipartBody.Part>>()
    val resEditFriendCircle = editFriendCircleLiveData.switchMap {
        LogUtils.d(tag, "编辑朋友圈")
        FriendCircleRepository.updateFriendCircle(it)
    }
    fun editFriendCircle(parts: List<MultipartBody.Part>){
        editFriendCircleLiveData.value = parts
    }
}